package com.lhw.ai.config;

import com.alibaba.cloud.ai.dashscope.api.DashScopeApi;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 初始化bean
 *
 * @author: lwh
 * @since: 2025/07/25 16:10:24
 * @version: 1.0
 */
@Configuration
public class InitConfig {

    @Value("${spring.ai.dashscope.api-key}")
    private String apikey;

    @Bean
    public DashScopeApi dashScopeApi() {
        // 初始化DashScopeApi: 其实可以自定义URL
        return DashScopeApi.builder()
//                .baseUrl()
                           .apiKey(apikey)
                           .build();
    }

}
